program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  Rectangle = class
    a, b, s: integer;
    procedure Square; virtual;
    procedure Update;
  end;
  SmartRectangle = class(Rectangle)
    procedure Square; override;
    procedure Set;
  end;
procedure Rectangle.Square;
begin
  writeln(s);
end;
procedure Rectangle.Update;
begin
  s:=a*b;
end;
procedure SmartRectangle.Square;
begin
  if (a*b<>c) then
    writeln('you are stupid');
end;
procedure SmartRectangle.Set;
begin
  readln(a,b);
end;

var
  t, p: integer;
  r, sr: rectangle;

begin
  r:=rectangle.Create;
  t:=1;
  while (t<>0) do
  begin
    readln(r.a,r.b);
    r.Square;
    r.Update;
    readln(p);
    if (t=0) then
      break;
  end;
  t:=1;
  sr:=SmartRectangle.Create;
  while (t<>0) do
  begin
    readln(sr.a,sr.b);
    sr.Set;
    r.Square;
    r.Update;
    readln(p);
    if (t=0) then
      break;
  end;
end.
